Repository navigation
Remove dead code from the FFI shim layer, link_interface tables, jssink/jest codegen, and REPL shims - #37788
Remove dead code from the FFI shim layer, link_interface tables, jssink/jest codegen, and REPL shims#37788robobun wants to merge 3 commits into
Conversation
…codegen surfaces Delete the JSC__*/ZigString__*/WebCore__* C-ABI shims in bindings.cpp that no Rust code calls (and their headers.h declarations), declarations in headers.h for functions that no longer exist, link_interface! methods nothing dispatches through (JsEventLoop, ErrnoNames, TranspilerCacheImpl), Rust exports with no C++ caller (console no-op hooks, Bun__tickWhilePaused, Bun__internal_drainTimers, Bun__getVerboseFetchValue, Bun__Timer__getNextID, WTFStringImpl ref/deref, BlobArrayBuffer_deallocator, WebSocket writeBlob, BigInt f64/u64 ordering), a few unreferenced helpers on the global object and NapiEnv, the per-sink __getter that generate-jssink.ts emitted for every sink, the unused call: true on the asymmetric matcher classes, and two REPL shim exports nothing reads. Bun.deepEquals relied on the deleted JSC__JSValue__deepEquals shim as the implicit instantiation point of Bun__deepEquals<false, false, false, false>; it is now instantiated explicitly next to the existing one.
|
Warning Review limit reached
Next review available in: 6 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (44)
Comment |
|
Updated 6:05 AM PT - Aug 12th, 2026
❌ @robobun, your commit 24c6dd5 has some failures in 🧪 To try this PR locally: bunx bun-pr 37788That installs a local version of the PR into your bun-37788 --bun |
There was a problem hiding this comment.
Beyond the two inline nits, I spot-checked that the removed symbols are actually unreferenced across src/: the WebSocket writeBlob exports, the Bun__ConsoleObject__{profile,record,screenshot} hooks, the seven <Sink>() constructor accessors, performanceObject()/navigatorObject()/hasNapiFinalizers(), the JsEventLoop::{pipe_read_buffer,stdout,stderr} dispatch arms, and the REPL shim exports (completion.js only destructures ALL_PROPERTIES/SKIP_SYMBOLS and only calls BuiltinModule.getSchemeOnlyModuleNames()). Also confirmed the removed StringJsc::to_range_error_instance is distinct from the still-live ZigStringJsc method of the same name, and the explicit Bun__deepEquals<false,false,false,false> instantiation is present.
Extended reasoning...
This is a large dead-code removal across 44 files in the FFI shim layer, so I'm not approving on my own, but the spot-checks above all came back clean and the two inline findings are cosmetic.
…-inspect header comment
|
Review follow-ups, both pushed:
Net diff is now +315 / -1211; the source lint still fails on |
There was a problem hiding this comment.
I reviewed this PR again after 522b44c / 24c6dd5 and didn't find any bugs — both earlier nits (the stale node-inspect.js header comment and the leftover <wtf/CrossThreadTask.h> include) are addressed, and the comment-cop items are resolved. Given the scope (~1,200 lines removed across 44 files in the core FFI shim layer — bindings.cpp, headers.h, ZigGlobalObject.{cpp,h}, plus link_interface! tables and two codegen surfaces), a human pass is still worthwhile.
What was reviewed:
- The one non-deletion change: the explicit
Bun__deepEquals<false,false,false,false>instantiation replaces the one the removedJSC__JSValue__deepEqualsbody used to provide — matches the callers inBunObject.cpp. jest.classes.tscall: trueremovals: confirmedgenerate-classes.tsonly wirescallinto a<Class>Class__callthunk on the constructor path, whichnoConstructor: truesuppresses;expect.any()etc. reachExpectAny::callviaexpect.rs.node-shims.jsONLY_ENUMERABLE/SKIP_STRINGS— checkedcompletion.jsonly destructuresALL_PROPERTIES/SKIP_SYMBOLS.timer_allimport removal inTimer.rs—timer_all_mutis still imported and used.
Extended reasoning...
Overview
This PR removes ~1,200 lines of dead code from the Rust↔C++ FFI shim layer (bindings.cpp, headers.h, headers-handwritten.h, helpers.h, BunString.cpp, JSBigIntBinding.cpp, ZigGlobalObject.{cpp,h}, napi.h, ScriptExecutionContext.h), the bun_dispatch::link_interface! tables in bun_core/bun_event_loop/bun_ast and their impl arms, several #[no_mangle] Rust exports (ConsoleObject noop hooks, Bun__tickWhilePaused, Bun__Timer__getNextID, BlobArrayBuffer_deallocator, WebSocket write_blob, etc.), two codegen surfaces (generate-jssink.ts per-sink __getter, jest.classes.ts call: true on 7 noConstructor matchers), and REPL shim exports. The additions are: one explicit template instantiation in bindings.cpp, comment/attribute adjustments, a #[cfg(test)] gate on SystemErrno::MAX for Windows, and a new source-lint test that pins every removed symbol.
The candidates were found by relinking with --gc-sections --print-gc-sections, then filtered against textual references across all source trees (so platform-gated and debugger-only code was left alone) and cross-checked at the symbol level against open PRs. The PR description lists what was intentionally left (URL::from_js, remaining simdutf__*, JSC__VM__notifyNeedDebuggerBreak, etc.) with the specific in-flight PR each conflicts with.
Security risks
None. This is purely subtractive against code the linker already discards; no new input handling, no auth/crypto/permission surfaces touched.
Level of scrutiny
High — not because the individual deletions are risky (each removed function was already dead in the shipped binary), but because of the breadth: 44 files across the core Rust/C++ binding boundary, including bindings.cpp (−609 lines), headers.h (−88 lines), and ZigGlobalObject.{cpp,h}. The one subtle correctness dependency is the explicit Bun__deepEquals<false,false,false,false> instantiation, which the author added after the first build broke — that's now in place next to the existing <true,false,false,true> instantiation. The link_interface! removals require knowing that no dispatch site names those methods, which is easy to get wrong for macro-generated tables; the source-lint test guards against re-addition but not against a missed live caller. A maintainer spot-checking the --print-gc-sections methodology and the open-PR coordination list would be valuable.
Other factors
- My two earlier inline nits (stale
node-inspect.jscomment, leftoverCrossThreadTask.hinclude) were addressed in 522b44c; the comment-cop flags were addressed in 24c6dd5 with per-thread replies. - Verification listed in the PR description covers full
bun bd,rust:check-allon all 10 targets,cargo test -p bun_errno, and the relevant test files for each touched subsystem. - The new source-lint test is well-scoped (reads source files, per-symbol regex checks, all 7 tests fail on
mainper the evidence block). - The
jest.classes.tschange touches the test-runner codegen input; I verified ingenerate-classes.tsthatcall: trueundernoConstructor: trueonly feeds the constructor's call slot, which is never emitted.
|
CI status for 24c6dd5 (build 93013): 193 of 194 jobs passed; the only red job is one of the two The expiry is a capacity problem on the |
… and misc crates (#39574) ### Problem - `src/jsc/bindings/libuv/` is only on the include path for non-Windows builds (`scripts/build/flags.ts`, "libuv stubs for unix"). `uv/win.h` (703 lines) and `uv/tree.h` (512 lines, included only by `win.h`) are never reached. - `uv/sunos.h`, `uv/os390.h`, `uv/aix.h` and `uv/posix.h` are selected by `uv/unix.h` only on Solaris, z/OS, AIX, IBM i, Cygwin, Haiku, QNX and Hurd. Bun builds for linux, macOS and FreeBSD. - `packages/bun-error` is embedded in the dev error page (`src/runtime/server/dev-error-page.html`). The page calls the function behind `Symbol.for("Bun__renderFallbackError")` and nothing else. `renderRuntimeError`, the abort state `dismissError` kept for it, and the two modules only it imported (`sourcemap.ts`, `stack-trace-parser.ts`) have no callers. #37081 lists this path as a follow-up. - `bun_zlib_sys::posix` and `bun_zlib_sys::win32` declare zlib functions that nothing calls. `bun_zlib` declares its own. The only use of the two modules was as re-exports of the types in `shared.rs`. - A set of `pub` items in other crates has no user in any crate. rustc cannot report them because `pub` items count as used. ### Fix - Delete the six libuv headers. `uv.h` now includes `uv/unix.h` directly. `uv/unix.h` keeps the linux, darwin and BSD branches. `uv-posix-polyfills.c` drops the commented-out copies of the removed branches. - Delete `renderRuntimeError`, `sourcemap.ts` and `stack-trace-parser.ts`. `dismissError` keeps the part that removes the overlay. `runtime-error.ts` stays (it has a test). - Delete `bun_zlib_sys/posix.rs` and `win32.rs`. `bun_zlib` imports the types from `bun_zlib_sys::shared`, which is where the removed modules took them from. - Delete the unused Rust items listed below, plus the trait implementations and imports that only they needed. Verification: - Every Rust item was found by making the unexported items crate-private and compiling the workspace. An item is deleted only if rustc reports it dead on x86_64 linux (dev, release, and with the `bun_debug` and `bun_asan` cfgs), aarch64 linux, x86_64 musl, x86_64 Windows and aarch64 macOS. - Each removed name was also searched in `src/codegen/`, the `*.classes.ts` files, `src/js/` and the C++ bindings. Items that a codegen template can emit were kept. - `bun run rust:check-all`: 12 of 12 targets pass. `cargo check --workspace --all-targets` passes (benches and unit tests still compile). `cargo check -p bun_shim_impl --features shim_standalone` for the Windows target passes. - `bun bd` builds. The build recompiles `uv-posix-stubs.c` and `uv-posix-polyfills.c` against the trimmed `uv.h`, and rebuilds the bun-error bundle, which no longer exports `renderRuntimeError`. - New test in `test/js/bun/http/serve.test.ts`: it takes the bun-error bundle out of a real 500 page, evaluates it outside a browser, and checks that the bundle registers the renderer and that `dismissError` is a no-op when nothing is rendered. This is the surface the `packages/bun-error` change touches. - `bun bd test` passes for `test/js/bun/http/serve.test.ts -t "dev error page"` (including the new test), `test/js/bun/runtime-error.test.ts`, `test/js/bun/util/{zstd,arraybuffersink,filesink}.test.ts`, `test/js/node/zlib/deflate-streaming.test.ts`, `test/js/web/encoding/text-{encoder,decoder}.test.*`, `test/js/workerd/html-rewriter.test.js`, `test/js/bun/css/nth-anplusb-ident.test.ts`, `test/js/web/fetch/blob.test.ts` and `test/internal/source-lints/dead-code-escapes.test.ts`. - `cargo fmt --check`, clang-format on the touched C file and prettier on the touched TypeScript files pass. <details> <summary>Removed Rust items</summary> - `bun_zlib_sys`: modules `posix` and `win32` (`struct_gz_header_s`, `gz_header`, `gz_headerp`, `in_func`, `out_func`, and the `deflate*`, `inflate*`, `compress*`, `uncompress`, `adler32`, `crc32`, `zlibVersion` declarations), `shared::voidpf`. - `bun_zlib`: declarations `compress`, `compressBound`, `uncompress`, and the `internal` module that selected between the two removed modules. - `bun_zstd`: `decompress` (every caller uses `decompress_append`). - `bun_libdeflate_sys`: `libdeflate_deflate_decompress` (the `_ex` variant is the one in use). - `bun_mimalloc_sys`: `mi_strdup`, `mi_heap_collect`, `mi_thread_set_in_threadpool`. - `bun_cares_sys`: `ares_strerror`. - `bun_windows_sys`: `SetHandleInformation`, `closesocket`. - `bun_alloc`: `default_alloc::calloc`. - `bun_core`: `GenericIndexInt::from_usize` and its macro-generated implementations. - `bun_css`: the four deprecated `to_css` methods on `GenericSelectorList`, `GenericSelector`, `GenericComponent` and `Combinator`. Their bodies were `unreachable!()`; the serializer functions replaced them. - `bun_runtime`: `JsSinkType::done` and its six overrides, `FileCloser::update` and its implementations, `ReadableStream::to_js`, `node_fs::Null::to_js`. </details> <details> <summary>Overlap with open pull requests</summary> The deletions here were checked against the open dead-code pull requests (#35437, #35775, #35880, #36115, #36237, #37012, #37149, #37181, #37208, #37301, #37454, #37659, #37788, #38005, #38900, #39319, #39561) and against #38958 and #35075. Nothing deleted here is deleted by any of them. Candidates they already cover were left out: `src/jsc/bindgen.rs` (#37149), the dead `pub use` re-exports (#39319), the simdutf big-endian and UTF-32 wrappers (#38958), and the items named in the skip lists of the others. Some files here (`bun_alloc/lib.rs`, `bun_core/util.rs`, `libdeflate.rs`, `mimalloc.rs`, `node_fs.rs`, `Blob.rs`, `FileSink.rs`, `ReadableStream.rs`, `streams.rs`, `windows_sys/externs.rs`) are also touched by open pull requests in different hunks. #36437 edits `packages/bun-error` from a base that predates #37081; it changes one import line in `stack-trace-parser.ts` and keeps `renderRuntimeError`, so it does not overlap with this deletion but will need a rebase. </details> <details> <summary>Found but not deleted (judgment calls for a maintainer)</summary> - `packages/bun-inspector-protocol/src/protocol/v8/` (about 32,600 lines): not exported by the package index since 2023 and regenerated only with the opt-in `--v8` flag of `scripts/generate-protocol.ts`. #39110 kept the flag, so this needs a decision. - `packages/h3blast` (1,468 lines) and `packages/bun-build-mdx-rs` (558 lines): nothing in the repository references them. They may be kept on purpose as a load generator and a proof of concept. - `packages/bun-error/runtime-error.ts` is unused by the page but covered by `test/js/bun/runtime-error.test.ts`. The four images in `packages/bun-error/img/` are referenced only by the source glob in `scripts/glob-sources.ts`. - `HotReloadTaskView` in `src/jsc/hot_reloader.rs`: both `reload` implementations ignore the task, and `VirtualMachine::reload` ignores its `Option<HotReloadTask>` argument. Removing the plumbing is a small refactor rather than a deletion. - `react_compiler/compile_result.rs` has constructors and fields with no users, but the file says the types are waiting to be wired up. - The streams-era private globals in `BunBuiltinNames.h` (`makeGetterTypeError`, `makeDOMException`, `addAbortAlgorithmToSignal`, `removeAbortAlgorithmFromSignal`, `isAbortSignal`, `createUninitializedArrayBuffer`, about 100 lines of `ZigGlobalObject.cpp`) have no JS callers. Both files are being edited by several open dead-code pull requests, so they were left for a later run. </details> ### Background - rustc's `dead_code` lint treats every `pub` item in a library crate as used, because another crate could import it. In this workspace every crate is an implementation detail of one binary, so a `pub` item with no importer in any crate is dead in the same sense as a private one. Making such items crate-private for one compile lets rustc report the ones with no users at all. The visibility changes themselves are not part of this pull request. - On POSIX, bun does not link libuv. Node-API addons that reference libuv symbols get `uv-posix-stubs.c` and `uv-posix-polyfills*.c`, which are compiled against the copied headers in `src/jsc/bindings/libuv/`. On Windows the real libuv is linked and that directory is not used. - `JsSinkType` is the Rust trait behind the native sink classes (`FileSink`, `ArrayBufferSink`, the HTTP response sinks). Its methods are called from the shared sink glue in `Sink.rs`; `done` was declared there but the glue never called it. <!-- robobun:evidence:begin --> --- **no test proof** · iteration 1 · Platform-specific test(s) that do not run on this machine. Deferring to CI, which covers all platforms: test/js/bun/http/serve.test.ts <!-- robobun:evidence:end -->
|
Closing as stale: this has merge conflicts with main. If the dead code is still present, please open a fresh PR against current main. |
…ockets, and the builtin-name tables (#38900) Removes 775 lines that nothing references (8 lines of signature, import and comment adjustments added), across node:http2, the HTTP/2 frame parser, the JSC/WebCore bindings, uSockets, four Rust crates, the builtin-name tables and scripts/. No behavior change. A 153-line source lint pins every removed symbol. ### Problem - `src/js/node/http2.ts` binds every entry of `constants` as a local (`const { ... } = constants;`); 178 of the 240 bindings have been unused since the block was added in #14286 (every call site reads `constants.X`). `const Socket = net.Socket` and the `#url` / `#isServer` fields of `ServerHttp2Session` are never read either (`tsc --noUnusedLocals`, re-checked by grep). - `_nativeAssertSettings` (`$newRustFunction("h2_frame_parser.rs", "jsAssertSettings")`) has been unused since #28074 gave http2.ts its own `assertSettings()`. That made `js_assert_settings` in `src/runtime/api/bun/h2_frame_parser.rs` (139 lines) and its facade re-export in `src/runtime/api.rs` unreachable: the js2native codegen was the only thing that named it. The three `BUN_DECLARE_HOST_FUNCTION(BUN__HTTP2_*)` lines in `ZigGlobalObject.cpp` are declarations of the Zig-era exports for the same helpers and have no definition anywhere. - `InspectorHTTPServerAgent::{startListening, stopListening, getRequestBody, getResponseBody}` are TODO stubs that nothing can dispatch to: the generated `HTTPServerBackendDispatcherHandler` in the pinned WebKit only declares `enable()` / `disable()`, so these `virtual ... final` methods override nothing and have no callers. - Declaration-only leftovers with no definition anywhere: `Bun__DNSResolver__new` / `Bun__DNSResolver__cancel` (`BunObject.cpp`), `jsBufferConstructorFunction_isBuffer` (`JSBuffer.cpp`, `Buffer.isBuffer` is a JS builtin), `getStringOption` (`CryptoUtil.h`). Plus the `IsIDLEnumeration` helper template (`IDLTypes.h`) and the `globalBuiltinFunction` macro (`ZigGlobalObject.cpp`), each with zero uses. - uSockets: `us_internal_ssl_sni_userdata` and `us_internal_ssl_handshake_abort` were added in #29932 and never called (`us_socket_server_name_userdata`, which the first one wrapped, stays). `us_cleanup_security_framework` (darwin) had no caller; the loader's failure paths are the only thing that ever frees a `SecurityFramework`, and they still do. The `SecTrustSettingsResult` typedef next to it was unused too. - Rust items no crate reaches (hawk `dead_public`, intersected over linux-gnu, linux-musl, android, freebsd, darwin and windows-msvc, then re-checked by hand): `ExprData::is_e_string`, `ArrayHashMap::get_adapted`, the debug-only `Behavior::eq`, and `js_parser::FunctionKind`, whose `Stmt` variant was never constructed. `validate_function_name` only ever ran for function expressions, so the parameter is gone and the one call site passes nothing; the error text already said "function expression". - Builtin-name tables: `Loader`, `byobRequest`, `controller`, `post`, `resume`, `started`, `state`, `textDecoder` and `view` in `BunBuiltinNames.h` have no `$name` / `@name` use in any builtin and no `namePublicName()` / `namePrivateName()` use in C++ (each entry costs two identifiers at VM startup). Their `builtins.d.ts` declarations go with them, as do the six `$stream*` `--define`s in `replacements.ts` (no builtin reads them; their only trace was the `.d.ts`), the `"Loader"` entry of `globalsToPrefix` (the only bare `Loader` in src/js is inside a block comment), and a duplicated `"Buffer"` entry. - `scripts/find-dead-exports.ts` (303 lines, #31254) was a textual approximation of the analysis `tools/hawk/` + `hawk.toml` now do (#36184); nothing references it. ### Fix - Deletes the items above; the only additions are the shorter `validate_function_name` signature, one comment in `semver/lib.rs` that named `get_adapted` (now names the surviving `get_index_adapted`), and the re-export line in `api.rs`. - Removing the `$newRustFunction` call is what makes the Rust function removable: `generate-js2native.ts` emits the `crate::api::bun::h2_frame_parser::js_assert_settings` thunk only for calls it finds in src/js, so after this change nothing generated names it either. `bundle-functions.ts` regenerates `BunBuiltinNames+extras.h` from the names builtins actually use, so a builtin-name entry that were still needed would be re-added by the build rather than break it; none was. - Verified: `bun bd` builds; `bun run rust:check-all` passes on all ten target triples; `cargo fmt --check` and prettier are clean. `bun bd test` passes on `test/js/node/http2/node-http2.test.js` (357), `test/js/node/http2/node-http2-continuation.test.ts`, `test/js/node/buffer.test.js`, `test/js/node/crypto/node-crypto.test.js`, `test/js/node/tls/node-tls-connect.test.ts`, `test/js/web/streams/streams.test.js` and `test/bundler/bundler_minify.test.ts`; `test/js/node/tls/node-tls-server.test.ts` passes 69/70, the remaining one (`SNICallback runs even when the requested servername matches the bind hostname`) fails identically with the released binary in this container (it binds `localhost` and connects to 127.0.0.1). The four function-name diagnostics `validate_function_name` emits are unchanged between the released binary and this build for both statement and expression positions. `bun test test/internal/source-lints/` passes (158 tests); the new `dead-symbols-http2-settings-inspector-stubs.test.ts` fails on main and passes here. - Cross-checked against the 22 open dead-code PRs at the symbol level (their diffs, not just file lists): nothing here is removed by any of them. Two hunks are adjacent to open ones and will need a trivial rebase on whichever side lands second: the `BUN__HTTP2_*` lines sit right under the `Bun__NodeUtil__jsParseArgs` line #37788 removes, and the `InspectorHTTPServerAgent` hunks are a few lines above the event dispatchers #37454 removes. One item found dead here, `JSValkeyClient::close_subscription_ctx`, is the renamed form of the `SubscriptionCtx::close` that #38439 already removes, so it was left to that PR. ### Background - js2native: `$rust("file.rs", "name")` / `$newRustFunction(...)` calls in src/js are collected at build time by `src/codegen/generate-js2native.ts`, which emits one thunk per call into `generated_js2native.rs` / `GeneratedJS2Native.h`. A Rust host function is therefore reachable only while some builtin names it; the `api.rs` facade module exists so the generated thunks have a stable path to call. - `BunBuiltinNames.h` is the list of private identifiers (`@name` in builtin JS, `builtinNames.namePrivateName()` in C++) that `BunBuiltinNames` interns when a VM starts. `bundle-functions.ts` diffs the names builtins use against this list and writes the difference to `BunBuiltinNames+extras.h`, which is why removing an entry can only ever remove startup work, never break a builtin. - Inspector agents: the WebKit inspector protocol generator turns each domain's JSON into a `*BackendDispatcherHandler` interface; a command reaches an agent only through that interface. The HTTPServer domain bun ships in its WebKit defines `enable` and `disable`, so methods an agent declares beyond those are unreachable by construction. - hawk (`tools/hawk/README.md`) is the workspace-wide reachability analysis the repo uses for `pub` items, since rustc's `dead_code` treats every `pub` item of a library crate as a root. Its per-target reports were intersected so that anything live under some `cfg` on any shipped platform was kept; the repr(C) FFI struct fields and flag/errno table entries it also reports were left alone on purpose, as in #38703. <details> <summary>Found dead but left alone (follow-ups, not in this diff)</summary> - `bun_sys::ErrorCase::LeakFdOnFail` is never constructed (every `make_lib_uv_owned_for_syscall` caller passes `CloseOnFail`), but removing it means dropping the parameter at 13 call sites, several of them in files open PRs are editing. - `libusockets.h` still declares `us_udp_socket_receive`, `us_udp_buffer_set_packet_payload`, `us_create_udp_packet_buffer` and `us_udp_socket_bind` with no definitions, and `udp.c` carries a commented-out `us_udp_packet_buffer_ecn`; both spots are adjacent to hunks in #37454. - `NapiEnv::currentFinalizer()` became unused in #37075 a week ago; left for that work to settle, as #37454 did with its siblings. - `replacements.ts` also emits a `$ImportKindLabelToId` define nothing reads, but it comes out of the same loop as three live tables. - `ws.js` `WebSocket.prototype.setSocket` (a throwing stub) and `async_hooks` `AsyncResource.emitBefore/emitAfter` have no in-tree users but are on exported classes. - `scripts/packer/build-image.pkr.hcl` and `scripts/trace.sh` have no invoker, but they are CI infrastructure rather than code; flagged for whoever owns those. - Everything else this pass turned up (about 270 C++ symbols and about 100 Rust items) is already deleted by one of the open dead-code PRs, and the roughly 400 never-read Rust fields hawk reports are all repr(C) mirrors of C structs. </details> --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
…uilt-in JS, bindgen, uSockets, and 66 Cargo manifests (#39732) ### Problem - The tree carries code that nothing references: FFI shims with no caller on either side, enum variants that are never constructed, write-only fields, exports that no module imports, and Cargo dependency edges that no source file uses. - 16 dead-code PRs that removed much of this were closed as stale after merge conflicts. Their deletions were never re-applied (list in the notes). ### Fix - Re-apply the deletions that still apply to current main and add new ones in the same areas: `simdutf_sys`, `ncrypto` and the WebCore bindings, `js_parser`, `bundler`, `js_printer`, `bun_install`, built-in JS, bindgen, uSockets, and 66 Cargo manifests. 176 files, +95 / -3129 (`Cargo.lock` is -436 of that). - Every deletion was checked again with `rg` over `src/`, `packages/`, `src/codegen/` and the generated code. Items that became live again since the old PRs stay (examples in the notes). - No deletion duplicates an open dead-code PR. Deletions that need #39618 or #39697 to land first are listed as follow-ups in the notes. - Verified: `bun bd`, `bun run rust:check-all` (12 targets pass), byte-identical bindgen output, `test/internal/source-lints`, and the test files of the touched areas (list in the notes). New tests in `transpiler.test.js` and `bundler_edgecase.test.ts` pin the two diagnostics that `mark_strict_mode_feature` still emits and the class body printing that `visit_class` still does. ### Background - A Rust `extern "C"` declaration with no call site creates no link reference, so a dead FFI chain is removed on both sides at once. Three C++ definitions whose Rust side #39618 removes stay until that PR lands. - `cargo check` covers the host target only. `rust:check-all` repeats it for every shipped target, which proves the `#[cfg]`-gated deletions and the Windows-only dependency removal (`bun_sys` -> `bun_output`). - The dependency removals are manifest-only. `Cargo.lock` loses the matching entries and nothing else: no version changes. <details><summary>Notes</summary> **Closed PRs re-applied**: #35437, #35559, #35775, #35880, #36115, #36237, #37012, #37062, #37089, #37208, #37272, #37454, #37788, #38005, #38439, #38703. **Kept because they are live again on main**: `GenericIndexOptional::{get, is_some, is_none}`, the WebSocket deflate `OutOfMemory` variants, `V8Local::reinterpret`, `SystemErrno::MAX`, `MarkPopErrorOnReturn::peekError`, `ResourceTiming::populateServerTiming`, `UvHandle` in `test/parallel/Channel.rs`, the `h2::FrameType` entries that `hawk.toml` marks as a code table. **Tests run**: node-http, node-http2, fetch headers, streams, readable-stream-blob-consumed, filesink, transpiler, buffer, url, FormData, TextEncoder, MessageChannel, serve-direct-readable-stream, serve-body-leak, crypto key objects, crypto-rsa, scrypt, pbkdf2, sqlite-sql, local-sql, postgres-simple-query-pipeline, sql-helpers-validation, bun-outdated, websocket-server, test/internal (bindgen, codegen outputs, source lints). The `localhost` proxy test in node-http and the concurrent WebSocket send tests fail the same way on unmodified main in this environment (the first is a `localhost` resolution issue, the second is the 300k-message benchmark starving its concurrent neighbours in a debug build). **By kind**: C/C++ -1327, Rust -702 (+75, mostly signature updates at call sites), built-in JS/TS -130, codegen TS -75 (+13), Cargo manifests -459, `Cargo.lock` -436. **simdutf_sys** (`simdutf.rs`, `bun-simdutf.cpp`, `parsers/benches/support/simdutf_shim.cpp`): 16 shim chains with no caller, each removed as Rust wrapper + `extern` declaration + C++ definition: `simdutf__convert_utf8_to_utf16le`, `_utf16be`, `_utf16be_with_errors`, `convert_utf8_to_utf32_with_errors`, `convert_valid_utf8_to_utf32`, `convert_utf16be_to_utf8_with_errors`, `convert_valid_utf16be_to_utf8`, `convert_utf32_to_utf8_with_errors`, `convert_valid_utf32_to_utf8`, `convert_utf32_to_utf16be_with_errors`, `convert_valid_utf32_to_utf16be`, `convert_utf16be_to_utf32_with_errors`, `convert_valid_utf16be_to_utf32`, `utf8_length_from_utf16be`, `utf32_length_from_utf16be`, `utf32_length_from_utf8`, plus the now empty `utf32` modules and the `be` wrappers. **ncrypto** (`ncrypto.h/.cpp`): `BignumPointer::isOne`, `X509View::ifRsa`, `X509View::ifEc`, `BIOPointer::NewFp`, `checkScryptParams`, `scrypt`, `pbkdf2`, `EVPKeyCtxPointer::setRsaMgf1Md`, `Rsa::encrypt`, `Rsa::decrypt` and the `RSA_Cipher` template, `Cipher::ForEach` with `CipherCallbackContext`/`array_push_back`, `NCRYPTO_REQUIRE`, `NCRYPTO_VERSION` and the version enum. **JSC / WebCore bindings**: `ZigGlobalObject`: `functionFulfillModuleSync` (and the `fulfillModuleSync` builtin name plus `$fulfillModuleSync` stub), `JSDOMFileConstructor_getter/_setter`, `navigatorObject`, `functionLazyNavigatorGetter`, `GlobalObject_getPerformanceObject`, `hasNapiFinalizers`, `jsFunctionNotImplemented`, `jsFunctionCreateFunctionThatMasqueradesAsUndefined`, `Zig__GlobalObject__getModuleRegistryMap`/`resetModuleRegistryMap`, `NodeVM*ModulePrototype()` accessors, `ZIG_GLOBAL_OBJECT_DEFINED`. `BunString.cpp`: `Bun__WTFStringImpl__ref`/`deref` definitions (Rust inlines these; #39618 removes the declarations). `JSBuffer.cpp`: the `JSValue`-name `validateOffset` overload and the three unused `jsBufferConstructorAlloc*WithoutTypeChecks` JIT operations. `NodeValidator`: `validateString(JSValue name)` and `validateOneOf(span<ASCIILiteral>)`. `ScriptExecutionContext`: `ensureOnMainThread`, `executionContext`. `napi.h`: `hasFinalizers`, `currentFinalizer`, `isVMTerminating`. `IDLTypes.h`: `IDLDate`, the `NullableTypeWithLessPadding` helpers and two includes. `BunProcess.cpp`: three unused `*CodeGenerator` aliases. `c-bindings.cpp`: `HNS_PER_SEC`, `NS_PER_HNS`, `HNS_PER_US`. `BunCommonStrings.h`: `ConnectionWasClosed`, `ec`, `ed25519`, `rsa`, `rsaPss`, `jwkDsa`, `jwkG`, `systemError`, `x25519`. `BakeAdditionsToGlobalObject.h`: the never-read `m_bakeGetAsyncLocalStorage` lazy property (the function is still installed directly) and the `LazyPropertyOfGlobalObject` alias. `JSBundlerPlugin.cpp`: the `JSBundlerPlugin__onVirtualModulePlugin` declaration, which has no definition. WebCore: `DeferredPromise::whenSettled` and the `PromiseFunction`/`BindingPromiseFunction` adapters, `JSEventListener::sourceURL/sourcePosition`, `Event::receivedTarget`, `toJS(PerformanceObserverCallback)` and `callbackData()`, `jsFetchHeaders_getRawKeys` (its only caller in `internal/http.ts` is removed too), stale forward declarations in `Performance.h`/`ResourceTiming.h`, and the commented-out `BINDING_INTEGRITY` blocks in 8 generated-style files. `node/crypto`: `JSPrivateKeyObjectConstructor` and `JSPublicKeyObjectConstructor` (4 files, superseded by `JSKeyObjectConstructor`). Bake: `BakeRegisterProductionChunk`, `BakeProdSourceMap`, `BakeProduction.h`, the `IncrementalGraph` log scope. **uSockets**: `us_poll_ext`, `us_loop_iteration_number`, `us_socket_is_tls`, `us_connecting_socket_get_loop`, `us_udp_packet_buffer_local_ip` / `bsd_udp_packet_buffer_local_ip`. **Rust**: `js_parser`: the six `StrictModeFeature` variants that are never constructed (and the `can_be_transformed` branch), `FnOnlyDataVisit::{class_name_ref, should_replace_this_with_class_name_ref, is_inside_async_arrow_fn}` with the `this` substitution path that was gated on the always-false flag (the `shadow_ref` arena cell becomes a plain `Ref`). `bundler`: `Linker::{resolver, hashed_filenames}`, `IS_CACHE_ENABLED`, `InputFileFlags::IS_PLUGIN_FILE`, `parse_task::Step::ReadFile`. `js_printer`: the write-only `Options::transform_only`. `bun_install`: `CacheBehavior`/`ManifestLoad` (every caller passed `LoadFromMemoryFallbackToDisk`, so the parameter and the memory-only branch are gone from `by_name`, `by_name_hash` and `by_name_hash_allow_expired`), `pub use patch_install as patch`. `webcore`: `ReadableStream::detach_if_possible` (empty) and the `global` parameter of `done()`, `BlobExt::{on_structured_clone_transfer, get_mime_type}`, six `StartTag` variants that no sink uses. `server`: `AnyRoute::ref_`, the write-only `OPENED_BIT`. `bun_core`: `concat`, `ExternalShared::as_ptr`, `QuoteEscapeFormatFlags::ascii_only`. `bun_io`: stale `Waker`/`Closer` re-exports. `bun_sys`: `UTIME_OMIT`. `cli`: the never-read `IS_MAIN_THREAD` thread local. `css`: `DeclarationContext::Keyframes`, the empty `generated_color_conversions` module. `html_rewriter`: the `EndTag.replace` host function that `html_rewriter.classes.ts` does not expose. **Built-in JS/TS**: `internal/http.ts`: 29 unused symbol constants, `filterEnvForProxies`, `getRawKeys`, `emitCloseNTAndComplete`, `ClientRequestEmitState`. `node/http2.ts`: `kSettingNames`, three unused primordials. `internal/sql/query.ts` and `internal/repl/node-shims.js`: export entries nothing imports, and the `BuiltinModule` shim methods nothing calls. `builtins.d.ts`: 8 stubs for builtin names that no longer exist. **bindgen** (`src/codegen/bindgen*.ts`): `allFunctions`, `ArgStrategyChildItem`, `Variant.argStruct`, `Struct.namespace`/`toString`, `FuncMetadata`/`exposedOn`/`ExposedOn`, `FuncWithoutOverloads`, the dead `debug` binding, two shadowed duplicate `case` labels and an unreachable `return`. Generated output is byte-identical. **Cargo**: 459 dependency lines across 66 manifests (mostly the `strum`/`bstr`/`scopeguard`/`const_format`/`enum-map`/`enumset`/`libc`/`bitflags` boilerplate block, plus 94 `bun_*` edges such as `bun_jsc -> bun_simdutf_sys` and `bun_bundler_jsc -> 8 crates`). One dev-dependency (`bun_router -> bun_js_parser`, checked with `cargo check -p bun_router --tests`). The manifests that #39618 and #39697 already edit (`collections`, `io`, `paths`, `css`, `shell_parser`, `sql`, `sql_jsc`) were left alone. **Rebase note**: main restructured the private builtin function registration in `ZigGlobalObject::addBuiltinGlobals` into a table (#39770). The conflict was resolved by dropping the `k_fulfillModuleSync` row from the new table, which is the same registration the first version of this PR removed. #39770 also touched the two `JS*KeyObjectConstructor.h` files before this PR deletes them; they are still unreferenced on main, so the deletion stands. Re-verified after the rebase: `bun bd`, `rust:check-all` 12/12, and the test files listed above. **Follow-ups once open PRs land** (not done here to avoid duplicating them): after #39618: the C++ definitions of `URL__fromJS` (BunString.cpp) and `Bun__allocUint8ArrayForCopy` (ZigGlobalObject.cpp), the seven `<Sink>()` constructor accessors in `ZigGlobalObject.h` that only the generated `__getter` functions use, the Rust `extern` declarations of `Bun__WTFStringImpl__ref/deref`, and `BufferWriter::append_null_byte` (no writer ever sets it to true). After #39697: the root `[workspace.dependencies] typed-arena` entry. Independently of those: the `DeferredPromise::{promise, resolve(), reject(...)}` overloads and `DOMPromise::whenPromiseIsSettled` have no callers but sit next to code #39618 edits. </details> <!-- robobun:evidence:begin --> --- **no test proof** · iteration 1 · Platform-specific test(s) that do not run on this machine. Deferring to CI, which covers all platforms: test/bundler/bundler_edgecase.test.ts <!-- robobun:evidence:end -->
Problem
link_interface!tables, a few#[no_mangle]Rust exports, two codegen surfaces, and the REPL shims.headers.hand the C++ sources declare functions that no longer exist anywhere, such as the 13Reader__*__fastpath/FFI__ptr__fastpathDOMJIT entry points.Fix
generate-jssink.tsstops emitting a per-sink getter that was installed for no sink, and the 7noConstructorjest matcher classes dropcall: true.--gc-sections --print-gc-sections) and textually unreferenced acrosssrc/,packages/,scripts/and regenerated codegen. Anything referenced only from another platform, a debugger entry point, or an open PR was left alone (listed under "Left alone on purpose" in the original).Bun.deepEquals(a, b)was getting itsBun__deepEquals<false, false, false, false>instantiation from a deleted shim body, so it gets an explicit one (the first build caught this); the WindowsSystemErrno::MAXbecomes#[cfg(test)]because its last non-test reader went away (rust:check-allon the Windows targets caught this).mainand pass here. The full debug build,rust:check-allon all 10 targets, and the runtime tests over the touched areas pass. Two tests timed out locally on a heavily loaded box; both are in paths this diff only removes unreferenced exports from, so CI is expected to pass them.Background
extern "C"shims inbindings.cpp, declared for Rust inheaders.h(the[[ZIG_EXPORT]]ones also get generatedcppbindwrappers); C++ calls Rust through#[no_mangle]exports. Neither compiler can tell when the other side stopped calling something; only the linker can.bun_dispatch::link_interface!: declares a table of methods a lower-level crate can call on a higher-level crate it cannot depend on directly; alink_impl_*!block in the higher crate supplies the arms. Removing a method means removing the table entry and its arm together.--gc-sections: with each function in its own section, the linker drops every section nothing references, and--print-gc-sectionslists what it dropped. That list is what "not in the shipped binary" means above.generate-jssink.tsemits the C++ wrapper class for each of the 8 sink types (ArrayBufferSinkand friends);jest.classes.tsis the input to the class-binding generator, wherecall: trueemits a<Class>Class__callthunk for the class's constructor function.template ...;line or the link fails.[review] gate passed · iteration 0 · 44 files touched
fails on main (without fix)
passes on PR (with fix)
diff hotspot
gate history · 2 passed · 0 rejected · iteration 0
evidence per changed file
Original description
Removes 1,208 lines that nothing references (55 lines added in src, all comment/attribute adjustments plus one explicit template instantiation; the rest of the additions are the source lint), across the Rust/C++ FFI shim layer, the
bun_dispatch::link_interface!tables, a handful of#[no_mangle]Rust exports, two codegen surfaces, and the REPL shims. No behavior change: every removed function was discarded by the linker, i.e. the shipped binary never contained it.How the candidates were found
The debug binary was relinked with
-Wl,--gc-sections -Wl,--print-gc-sections; the discarded.text.*sections from bun's own objects (C++ andlibbun_rust.a) gave the set of functions nothing references at link time. That set was then filtered bysrc/,packages/,scripts/and the regeneratedbuild/debug/codegen/output, so anything still referenced from code that only compiles on another platform (Bun__Process__hasTitle,archive_entry_set_pathname_utf8,bun_sysconf__SC_CLK_TCK, the kqueue no-orphans hooks, ...) or reached only from a debugger entry point (dumpBtjsTraceand everything under it) was left alone;StringJsc::to_range_error_instance->JSC__createRangeError,FetchHeaders::from->WebCore__FetchHeaders__createValue,Bun__tickWhilePaused->EventLoop::tick_while_paused);JSC__VM__notifyNeedDebuggerBreak, which Start the inspector at runtime on SIGUSR1 / process._debugProcess #37336 adds a caller for).Additionally every declaration in
headers.hand everyextern "C"declaration in the C++ sources was checked against the symbols the binary actually defines, which found the declarations for functions that no longer exist anywhere.Removed
bindings.cpp/headers.h(about 680 lines)68 C-ABI shims that no Rust code declares or calls any more (the Rust
JSValue/JSPromise/VMtypes implement these inline or never needed them), together with theirheaders.hdeclarations and thecppbindwrappers generated for the[[ZIG_EXPORT]]ones:JSC__JSValue__{isCell, isNull, isUndefined, isUndefinedOrNull, isNumber, isObject, isInt32, isInt32AsAnyInt, isError, isGetterSetter, isCustomGetterSetter, eqlCell, deepEquals, jsNumberFromChar, jsNumberFromU16, jsNumberFromInt32, jsNumberFromInt64, jsNumberFromUint64, jsTDZValue, jsType, createInternalPromise, createRangeError, createTypeError, fastGetDirect_, getPropertyValue, putRecord, symbolKeyFor}JSC__JSInternalPromise__{create, isHandled, reject, rejectAsHandled, rejectAsHandledException, rejectedPromise, resolve, result, setHandled, status}(the type is aliased toJSPromise; onlyresolvedPromiseis used),JSC__JSPromise__{asValue, isHandled, resolveOnNextTick, rejectOnNextTickWithHandled}JSC__JSObject__{getArrayLength, getDirect, putDirect},JSC__JSCell__{getObject, toObject},JSC__JSString__toObject,JSC__JSFunction__optimizeSoon,JSC__JSGlobalObject__{getCachedObject, putCachedObject},JSC__JSMap__has,JSC__JSModuleLoader__evaluate,JSC__createRangeErrorJSC__VM__{clearExecutionTimeLimit, setExecutionTimeLimit, deleteAllCode, isEntered, isJITEnabled, notifyNeedShellTimeoutCheck, notifyNeedWatchdogCheck, performOpportunisticallyScheduledTasks}ZigString__{to16BitValue, toAtomicValue, toExternalValueWithCallback},WebCore__DOMURL__{href_, pathname_},WebCore__FetchHeaders__createValue(+FetchHeaders::fromin Rust),Bun__CallFrame__isFromBunMain, andZig::toJSStringinhelpers.h, which only the twocreate*Errorshims usedReader__*__fastpath/FFI__ptr__fastpathDOMJIT entry points (only the slow paths exist),JSC__JSGlobalObject__createSyntheticModule_,JSC__JSValue__{then, createStringArray, hasOwnProperty, toString},JSC__VM__create,ZigException__fromException,Zig__GlobalObject__{fetch, promiseRejectionTracker}, a stray_fromJSBun.deepEquals(a, b)was getting itsBun__deepEquals<false, false, false, false>instantiation from the deletedJSC__JSValue__deepEqualsbody, so it now has an explicit instantiation next to the existing one for<true, false, false, true>(this is what the first build of this branch caught).link_interface!methods nothing dispatches throughJsEventLoop::{file_polls, put_file_poll, pipe_read_buffer, stdout, stderr}(bun_event_loop) and theirJscarms inbun_jsc::event_loop, plusEventLoop::pipe_read_buffer, which only the arm called. The livepipe_read_bufferisbun_io'sEventLoopCtx, a different interface.ErrnoNames::{max_dense, win32_name}(bun_core) and theirSysarms,win32_errno_nameandsystem_errno_max_denseinbun_errno; the WindowsSystemErrno::MAXthat onlymax_denseread becomes#[cfg(test)](the exhaustive round-trip test still iterates it, and the Win32 mapping test now callsinit_win32_errordirectly).TranspilerCacheImpl::is_disabled(bun_ast) and itsJscarm;RuntimeTranspilerStorecalls the inherentis_disabled()directly.Rust exports with no C++ caller
Bun__ConsoleObject__{profile, profileEnd, record, recordEnd, screenshot}and theconsole_noop_hooks!macro;ConsoleObject.cpponly forwardstimeStamp, which is now a plain functionBun__tickWhilePaused+EventLoop::tick_while_paused(+ two declarations inBunDebugger.cpp;runWhilePausedblocks on a condition variable now),Bun__internal_drainTimers,Bun__getVerboseFetchValue(declared inJSEnvironmentVariableMap.cpp, never called),Bun__Timer__getNextIDBun__WTFStringImpl__{ref, deref}on both sides (the Rust comment already said "Rust no longer calls these"; ref/deref are inlined inbun_alloc, onlydestroycrosses FFI),BlobArrayBuffer_deallocatorinblob/Store.rs(Blob.rshas the liveblob_store_array_buffer_deallocator),WebSocket::write_bloband its two__writeBlobexports (WebSocket.cppsends blobs throughwriteBinaryData),Bun__linux_trace_closeJSC__JSBigInt__{orderDouble, orderUint64}and theBigIntOrderableimpls forf64/u64; onlyi64comparisons are performedexport = "Bun__NodeUtil__jsParseArgs"/"PostgresSQLConnection__createInstance"symbol names (both functions are reached through Rust tables; the C++BUN_DECLARE_HOST_FUNCTIONfor the former is gone too)C++ helpers
ZigGlobalObject:JSDOMFileConstructor_getter/_setter,functionLazyNavigatorGetter+navigatorObject(),GlobalObject_getPerformanceObject+performanceObject()(navigator/performanceare installed from the LUT directly),hasNapiFinalizers()+NapiEnv::hasFinalizers(),NapiEnv::isVMTerminating(),ScriptExecutionContext::postCrossThreadTask, theNodeVM*ModulePrototype()accessors<Sink>()constructor accessors whose only reader was the generated getter below (ArrayBufferSink()stays;BunObject.cppuses it)Codegen
generate-jssink.tsno longer emitsfunction<Sink>__getter, which was declared and defined for all 8 sinks and installed for none of themjest.classes.ts:call: trueon the 7noConstructorasymmetric matcher classes only produced a<Class>Class__callthunk that the (non-existent) constructor would have used;expect.any()etc. reachExpectAny::callthroughexpect.rsdirectlyBuilt-in JS
internal/repl/node-inspect.js: theformat/formatWithOptionsgetters;internal/repl/node-shims.js:BuiltinModule.{exists, canBeRequiredByUsers, canBeRequiredWithoutScheme}and twoconstantsentries (completion.js is the only consumer and destructures neither)test/internal/source-lints/dead-symbols-ffi-shims-dispatch.test.tspins every removed symbol; all 7 tests fail onmainand pass here (each regex was also checked individually to match onmain).Verification
bun bd(full debug build) passes;bun run rust:check-allpasses on all 10 target triples (the first run failed on the two Windows targets becauseSystemErrno::MAXbecame unused there, which is the#[cfg(test)]change above);cargo test -p bun_errno; rustfmt, clang-format, prettier and oxlint are clean.bun bd testpasses ontest/js/bun/test/expect.test.js,test/js/bun/bun-object/deep-equals.test.ts,test/js/bun/globals.test.js,test/js/web/web-globals.test.js,test/cli/run/transpiler-cache.test.ts,test/js/bun/repl/repl.test.ts,test/js/web/websocket/{websocket-blob,websocket-client}.test.ts,test/js/bun/util/{arraybuffersink,filesink}.test.ts,test/js/node/readline/readline.node.test.ts,test/js/node/fs/fs-stats-constructor.test.ts,test/js/web/timers/setImmediate.test.js,test/js/bun/console/console-write.test.ts, andtest/internal/source-lints/. Two tests timed out locally (setInterval doesn't leak memoryat 30s and the parseArgs100 mixed several timesstress test at 5s); the container was running at a load average of ~55 on 16 cores and the release binary runs both in well under a second, and neither path is touched functionally here (the timer change removes two unreferenced exports, the parseArgs change removes an unused symbol name), so I expect CI to disagree with my machine rather than with the diff.return 0;), and none adds a reference to them.Left alone on purpose
JSC__VM__{hasTerminationRequest, isTerminationException}+VM::has_termination_requestandJSC__VM__notifyNeedDebuggerBreakare unreferenced but sit in the middle of One termination signal, one fold: Err(Thrown) always means an exception is pending, and each event-loop dispatcher takes it in one place #37275 / get a caller in Start the inspector at runtime on SIGUSR1 / process._debugProcess #37336.URL::from_js/URL__fromJShas no callers, but Make jsc::URL a re-export of bun_url with a UrlJsc extension trait #37359 rewritesURL.rs;jsFunctionCreateFunctionThatMasqueradesAsUndefinedis unreferenced but adjacent to node:path: rewrite on JSString storage in Rust, match Node.js v26 exactly, ~3x faster #37305's hunks, andjsFunctionNotImplementedgets a caller in Clear pending exceptions from lazy property getters during property enumeration #37213.simdutf__*wrappers (the*_with_errors,convert_valid_*andutf32_length_*family) anduws_{app_listen, app_run, h3_req_get_parameter, loop_defer, res_clear_corked_socket, ws_iterate_topics}are interleaved with the hunks of Remove dead code from libuv_sys, cares_sys, simdutf FFI, test_runner, and C++ bindings #37332 / Remove dead code from uws_sys, webcore bindings, crash_handler, and scripts #37181 in the same extern blocks; they can go once those land.Bun__JSBigIntStatsObjectConstructor(only reached from theBIG = trueinstantiation ofStat::get_constructor, which nothing calls),Bun__allocUint8ArrayForCopy(theUint8Arrayarm ofArrayBuffer::alloc) andBun__WebSocketClientTLS__initWithTunnelare dead instantiations of otherwise live generic/macro code and need a small refactor rather than a deletion.__setDestroyCallback/__createObject/__assignToStreamand the per-class__fromJS/__dangerouslySetPtr/*CachedValuethunks that happen to be unused for some sinks/classes are uniform codegen output; the<Class>_getterexpansions inZigGlobalObject.cppstill need the macro split Remove dead code from node:crypto bindings, JSC/WebCore bindings, uSockets, and llhttp #37454 mentioned.